package com.zxx.pattern.prototypePattern.prototype2_ZZ;

/**
 * @author zxx on 2020/12/21
 */
public class ProtoTypeTest2 {

    public static void main(String[] args) {
        ShapeCache2.loadShape();

        Shape2 cloneShape = ShapeCache2.getShape("1");
        System.out.println("Shape2 : " + cloneShape.getType());
        cloneShape.draw();

        Shape2 clonedShape2 = (Shape2) ShapeCache2.getShape("2");
        System.out.println("Shape2 : " + clonedShape2.getType());
        clonedShape2.draw();

        Shape2 clonedShape3 = (Shape2) ShapeCache2.getShape("3");
        System.out.println("Shape2 : " + clonedShape3.getType());
        clonedShape3.draw();
    }

}
